1. Field of the Invention
The present invention relates to an image processing method, an image processing apparatus, a program of the image processing method and a recording medium recording the program of the image processing method and may be applicable to a digital still camera, for example. According to the invention, encoded data pieces are sorted after decoding processing, image processing and encoding processing are performed on sequentially input encoded data pieces in image processing units, whereby the capacity of a buffer memory that temporarily stores an image processing result can be reduced.
2. Description of the Related Art
In the past, an imaging apparatus such as a digital still camera performs encoding processing on an imaging result by a scheme such as Joint Photographic Coding Experts Group (JPEG), for example, and records the encoded data based on the processing result on a recording medium. In accordance with an operation by a user, the imaging apparatus decodes and performs image processing on the imaging result recorded on the recording medium and then performs encoding processing again and records the image processing result on the recording medium.
The image processing here may include rotation processing on an image, scaling-up/down processing on an image by conversion of resolution, which is called resizing, and trimming processing. Imaging results recorded on a recording medium are sequentially extracted in image processing units based on the block size suitable for image processing and in an image processing order. On the other hand, the encoding processing such as JPEG has a format defining that encoding processing is performed in encoding processing units including macro blocks sequentially in a raster scanning order.
Thus, an imaging apparatus stores image-processed imaging results in a buffer memory once for one picture plane and then performs encoding processing thereon and records them on a recording medium.
FIG. 16 is a flowchart showing a series of steps relating to the image processing including resizing and trimming processing. An imaging apparatus starts the processing steps in accordance with an operation by a user in step SP1, which is followed by step SP2 where an imaging result recorded on a recording medium is decoded. Thus, image data based on the imaging results in an image processing unit, which is a block size subject to image processing, can be obtained.
In the next step SP3, the obtained image data is recorded in a buffer memory after resizing processing, for example, thereon. In the next step SP4, whether any unprocessed part remains or not is determined. Here, if the determination result is affirmative, the imaging apparatus returns to step SP2. Thus, in this case, the imaging apparatus repeats the processing steps SP2-SP3-SP4-SP2 in image processing units in an imaging processing order. When all image processing units have been completely processed, the determination result in step SP4 becomes denial. Then, the processing moves to step SP5. Hence, the imaging apparatus image-processes and stores imaging results for one picture plane in the buffer memory. Then, in step SP5, the image processing results stored in the buffer memory undergo encoding processing and are recorded on a recording medium. Then, the processing moves to step SP6 where the processing ends.
FIG. 17 shows a case that an image is scaled down by resizing. The imaging apparatus image-processes an imaging result recorded on a recording medium in image processing units including the shown partial images 1, 2 and 3 resulting from the horizontal equal division of the original image based on an imaging result into three. Then, the image processing results are stored and held in the buffer memory, and the processing results for one picture plane are stored in the buffer memory. After that, the processing results stored in the buffer memory are sequentially encoded in encoding processing units and are recorded on a recording medium.
JP-A-11-298878 discloses a construction of the encoding processing in which MPEG streams are sorted and are scrambled.
By the way, in order to store and perform encoding processing on the image-processed imaging results for one picture plane in a buffer memory, the buffer memory may require a memory with a large capacity enough for holding images based on the image processing results for one picture plane. Therefore, the capacity of the buffer memory for temporarily holding image processing results may be increased, which is a problem.